
pub enum FieldTypes{
    String,
    I32,
    I64,
    F32,
    F64,
    None
}

impl FieldTypes{
    pub fn from(val: &str) -> FieldTypes {
        match val {
            "string" => FieldTypes::String,
            "i32" => FieldTypes::I32,
            "i64" => FieldTypes::I64,
            "f32" => FieldTypes::F32,
            "f64" => FieldTypes::F64,
            _ => FieldTypes::None
        }
    }


    pub fn name(&self) -> &'static str{
        return match self
        {
            FieldTypes::String => "string",
            FieldTypes::I32 => "i32",
            FieldTypes::I64 => "i64",
            FieldTypes::F32 => "f32",
            FieldTypes::F64 => "f64",
            FieldTypes::None => ""
        }
    }
}
